package com.yc.spring.jdbc;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class B{

    // 如果要让该方法出现 传播特性 报错, 外部方法如何设置事务
    @Transactional(propagation = Propagation.MANDATORY)
    public void b1(){
        System.out.println("--------- b ------");
    }

    @Transactional(propagation = Propagation.NEVER)
    public void b(){
        System.out.println("--------- b ------");
    }
}